package com.tianyu.inspection.common;

import com.tianyu.inspection.entity.User;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.regex.Pattern;

/**********************************
 * @Author YSW
 * @Description 全局变量
 * @Date 2020.12.17 - 14:57
 **********************************/

public class Constants {

	/**
	 * projectId
	 */
	public static final Map<String, CountDownLatch> GLOBAL_LOCK_MAP = new ConcurrentHashMap<>();

	/**
	 * 线程池
	 */
	public static final ThreadPoolExecutor EXECUTOR = new InspectLineExecutor();

	/**
	 * 定时任务线程池
	 */
	public static final ScheduledExecutorService SCHEDULED_EXECUTOR = new InspectLineScheduledExecutor();

	/**
	 * 正则匹配数字
	 */
	public static final Pattern NUMBER_PATTERN = Pattern.compile("(-?[1-9]\\d*\\.?\\d*)|(-?0\\.\\d*[1-9])");

	/**
	 * 正则匹配数字
	 */
	public static final Pattern DATE_PATTERN = Pattern.compile("[0-9]{4}-[0-1][0-9]-[0-3][0-9]");

	public static final ThreadLocal<User> USER_THREAD_LOCAL = new ThreadLocal<>();

	/**
	 * 实体对象名称
	 */
	public static final String LOGGER = "日志";
	public static final String CLIENT_SOFTWARE = "客户端软件";
	public static final String CONSTRUCTION_TYPE = "施工类型";
	public static final String CONSTRUCTION_UNITS = "施工单位";
	public static final String CAMERA = "摄像头";
	public static final String CAMERA_TYPE = "摄像头类型";
	public static final String DANGER = "险情";
	public static final String DANGER_PROCESS = "详情处理";
	public static final String DANGER_TYPE = "详情类型";
	public static final String FLY_TASK = "飞行任务";
	public static final String HIGH_CONSEQUENCE_AREAS = "高后果区";
	public static final String HIGH_CONSEQUENCE_AREAS_TYPE = "高后果区类型";
	public static final String INFRASTRUCTURE_TYPE = "基础设施";
	public static final String ORTHOGRAPHIC_IMAGE = "正射影像";
	public static final String PENETRATE_POINT = "穿越点";
	public static final String PENETRATE_POINT_TYPE = "穿越点类型";
	public static final String PILE_CARD = "桩牌";
	public static final String PILE_CARD_TYPE = "桩牌类型";
	public static final String PIPELINE = "管线";
	public static final String PIPELINE_POINT = "管线点";
	public static final String PIPELINE_STATION = "管线站场";
	public static final String PROJECT = "项目";
	public static final String ROLE = "角色";
	public static final String UPLOAD_FILE = "上传文件";
	public static final String USER = "用户";
	public static final String GENERAL_FACILITIES = "通用设施";
	public static final String GENERAL_FACILITIES_TYPE = "通用设施类型";

	/**
	 * 角色接口类型
	 */
	public static final String API_SUPER = "超级管理员接口";
	public static final String API_ADMIN = "企业管理员接口";
	public static final String API_COMPANY = "企业普通用户接口";
	public static final String API_PATROL = "巡线人接口";
	public static final String API_COMMON = "通用接口";

	/**
	 * 请求方式接口类型
	 */
	public static final String GET_LIST = "请求方式[列表获取]";
	public static final String GET_ONE = "请求方式[单例获取]";
	public static final String OPERATOR = "请求方式[操作]";
	public static final String INSERT = "请求方式[插入]";
	public static final String UPDATE = "请求方式[更新]";
	public static final String DELETE = "请求方式[物理删除]";
	public static final String DELETE_LOGICALLY = "请求方式[逻辑删除]";
}
